package com.moss.system.mapper;


import com.moss.common.domain.LoginUser;
import com.moss.common.entity.SysRoleEntity;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

import java.util.List;

@Mapper
public interface RoleMapper {
    List<SysRoleEntity> getRoleList(SysRoleEntity role);

    List<SysRoleEntity> selectRolePermissionByUserId(String userId);

    SysRoleEntity selectRoleByRoleName(@Param("roleName") String roleName);

    void insertBatch(@Param("user") LoginUser loginUser, @Param("roleList") List<SysRoleEntity> roleList);

    Integer findMaxSort();

    void insert(SysRoleEntity role);

    SysRoleEntity selectById(Long roleId);

    void updateRole(SysRoleEntity role);

    SysRoleEntity selectRoleByRoleKey(String roleKey);

    void removeBatchIds(@Param("arr") Long[] roleIds);

    Long[] selectUserRoleIds(String userId);

    void removeUserRole(String userId);

    void insertUserRole(String userId, @Param("arr") Long[] roleIds);
}
